540 M=M%: TP=0:FOR I = 1 TO M: IF A(I,2)>TP THEN TP=A(I,2)
550 NEXT I: EE= TP
560 FOR I=1 TO M-1
570 FOR J=I+1 TO M
580 IF A(I,1)<=A(J,1) THEN 610
590 FOR K=1 TO 11: SV(K)=A(I,K):A(I,K)=A(J,K):A(J,K)=SV(K):NEXT K
600 FOR K=1 TO 2: SV$(K)=A$(I,K):A$(I,K)=A$(J,K):A$(J,K)=SV$(K):NEXT K
610 NEXT J,I
620 CLS
630 XX=5: COLOR 14,0,0:PRINT TAB(25);"VERIFICATION OF INPUT":PRINT:COLOR 7,0,0
640 Z1$="Code Description Expected Early Early Last Last Slack"
650 Z2$=" Time Start Fin. Start Fin. Time"
660 Z3$="Code Description Begin End Optimist Likely Pessimist"
670 Z4$=" Event Event Time Time Time "
680 PRINT "No. ";Z3$
690 PRINT " ";Z4$
700 K=0
710 C4$="### "
720 FOR I=1 TO M%
730 PRINT USING C4$;I;
740 C1$=" #### "
750 C2$="\ \":C3$=" ####.## "
760 PRINT USING C2$;A$(I,1),A$(I,2);
770 FOR J=1 TO 2
780 PRINT USING C1$;A(I,J);:NEXT J
790 FOR J=3 TO 5
800 PRINT USING C3$;A(I,J);:NEXT J
810 K=K+1: IF K>=20 THEN MSG$ ="Enter to Page":LGTH=1:ANSWER$="":GOSUB 10000
820 PRINT: NEXT I
830 COLOR 7: MSG$= "Please input a -2 to add more,-1 to continue, or number (E.G., 03) to change ":LGTH=2:GOSUB 10000:ANSWER=VAL(ANSWER$):L=ANSWER:IF L=-1 THEN 905
840 IF L<>-2 THEN 860
850 L=M%+1: M%=L:N%=N%+1:XCHECK=1:GOTO 860
860 IF L>M% THEN GOTO 830: ELSE GOSUB 20000:IF ABORT GOTO 830
865 INPUT "New Code Name/Letter or END to ABORT ";A$(L,1)
867 IF A$(L,1)="END" THEN GOSUB 22000:GOTO 830
870 INPUT "New Description ";A$(L,2): INPUT "New Beginning Event Number "; A(L,1)
880 INPUT "New Ending Event Number"; A(L,2):INPUT "New Optimistic End ";A(L,3)
890 INPUT "New Likely End ";A(L,4):INPUT "New Pess. End ";A(L,5)
900 GOTO 620
905 MSG$ ="Want hard copy of your data ":LGTH=1:GOSUB 10000:P$=ANSWER$: IF P$<>"Y" AND P$<>"y" THEN 1040
1610 CLS:LOCATE 5,30:COLOR 4,0,0:PRINT "CRITICAL PATH":PRINT PATH$:PRINT: COLOR 7,0,0
1620 PRINT "Time of Critical Path ":PRINT USING C6$;CO:INPUT "Scheduled Project Time (use same time units as data) ";ST:Z=(ST-CO)/SI:XX=0
1630 BB$="Probability of being completed on time ": IF Z<0 THEN 1670
1640 A=.4361836:B=-.1201676:C=.937298: D=(2.7182818#^(-Z^2/2))*(2*3.1415926#)^ (-.5):E=(1+.3326*Z)^(-1):P=1#-D*(A*E+B*E^2+C*E^3):IF XX>0 THEN 1660
1650 COLOR 12,0,4:PRINT USING "Z= ##.### ";Z;:PRINT BB$;:PRINT USING "#.###";P: COLOR 7,0,3:GOTO 1680
1660 PRINT USING "Z= ##.### ";-Z;:PRINT BB$;:PRINT USING "#.###";1-P:COLOR 7: GOTO 1680
1670 XX=99: Z=-Z:GOTO 1640
1680 MSG$="Hard Copy (Y/N) ":LGTH=1:GOSUB 10000:P$=ANSWER$: IF P$<>"y" AND P$<>"Y" THEN 1490
1690 LPRINT " ":LPRINT "CRITICAL PATH":LPRINT PATH$:LPRINT " ":LPRINT "Scheduled project time is ";ST
1700 LPRINT "Time of critical path ":LPRINT USING C6$;CO: IF XX=0 THEN LPRINT "Z= "; Z;" ";BB$;P:GOTO 1490
1710 IF OP$="E" AND OP$="e" THEN END
1720 IF OP$<>"D" AND OP$<>"d" THEN 1770
1730 LINE INPUT "Name of disk:file ";X$:OPEN "O",1,X$
1740 PRINT#1,M%,EE
1750 FOR I=1 TO M%:PRINT#1,CHR$(34);A$(I,1);CHR$(34);",";CHR$(34);A$(I,2); CHR$(34);A(I,1);A(I,2);A(I,3);A(I,4);A(I,5):NEXT I
1760 CLOSE #1: GOTO 1490
1770 SCREEN 0,0,0:WIDTH 80:COLOR 9,0,0:PRINT "ENDING...";:COLOR 7,0,0: FOR I=1 TO 1000:NEXT: KEY ON:END
1775 DATA 18,9
1780 DATA "A","ACCT. PAPERS",1,2,1,2,3
1790 DATA "Z","PERMITS", 2,7,4,5,8
1800 DATA "B", "SHOP BANKERS", 1,3,2,4,6
1810 DATA "C","SHOP REAL EST.", 1,4,2,13,17
1820 DATA "D","MARKET STUDY", 2,3,2,4,5
1830 DATA "G","CONTRACTOR", 2,5,1.4,2.2,6.7
1850 DATA "H","ART PLANS", 3,5,2,4,6
1860 DATA "E","COST STUDY", 3,4,3,4,5
1870 DATA "I","LAND", 4,5,8,11,13
1880 DATA "J","MATERIAL", 5,6,2,3,4
1890 DATA "K","PLANS", 5,7,2,5,12
1900 DATA "L","SURVEY", 5,8,1,2,4
1910 DATA "M","BUY MAT #1", 6,8,2,3,4
1920 DATA "O","BUY MAT #2", 6,9,1,2,5
1930 DATA "N","LAYOUT", 7,8,9,11,12
1940 DATA "P","FOUNDATION", 8,9,1,3,6
1950 DATA "Q","HIRE CREW 2", 7,9, 1,2,3
1960 DATA "F","INSURANCE", 2,6,.4,1.3,1.5
10000 REM This subroutine saves the cursor position as ONCE (Col. or Y)
10010 REM and WAS (Row or X), locates the cursor on the 25th status line
10020 REM gets an input value (string only), and returns the cursor to
10030 REM where it ONCE WAS.
10040 REM Input Variables = MSG$;Output = ANSWER$
10050 REM LGTH of desired ANSWER
10060 ' Store cursor position
10070 ONCE = CSRLIN
10080 WAS = POS(0)
10085 ANSWER$="" 'empty the answer string
10090 ' Make sure softkeys are off, locate cursor on 25th line
10100 KEY OFF
10110 LOCATE 25,3
10120 ' Print the message the user requests and get an input
10130 PRINT MSG$;:ANSWER$=INPUT$(LGTH)
10150 ' Clear off the line for future use
10160 LOCATE 25,1:PRINT SPC(79);
10170 ' Restore the cursor to where it was
10180 LOCATE ONCE, WAS
10190 RETURN
15000 REM This subroutine does some error-checking, for instance, for the
15010 REM open statement in line 390
15020 REM It requires a ON ERROR GOTO 15000 statement at front of program
15025 MISTEAK=0:WHEREAT=0
15030 MISTEAK = ERR: WHEREAT=ERL
15040 IF MISTEAK = 55 THEN CLOSE:RESUME
15050 IF MISTEAK = 53 THEN PRINT"CAN'T FIND THAT FILE - CATALOG: ":COLOR 3:PRINT "A:":FILES "A:*.*":COLOR 9:PRINT "B:":FILES "B:*.*":PRINT:PRINT"WAIT...": FOR I= 1 TO 7000:NEXT I:RESUME 130
15060 IF MISTEAK = 61 THEN PRINT"DISK IS FULL - PLEASE GET ANOTHER:FOR I=1 TO 3000:NEXT I:RESUME 1730
15070 IF MISTEAK = 64 THEN PRINT"THAT'S NOT A GOOD FILE NAME-USE B:XXXXXXX.YYY": FOR I=1 TO 3000:NEXT I:RESUME 130
15075 IF MISTEAK = 68 THEN PRINT "THAT DISK DOESN'T EXIST...USE A: OR B:": FOR I=1 TO 3000:NEXT I: RESUME 130
15080 IF MISTEAK = 70 THEN PRINT "THE DISK IS WRITE-PROTECTED - CAN'T USE IT": FOR I=1 TO 3000:NEXT I:RESUME 130
15090 IF MISTEAK = 71 THEN PRINT "CLOSE THE DISK DOOR":FOR I=1 TO 3000:NEXT I: RESUME 130
15100 IF MISTEAK =72 THEN PRINT "I THINK THE DISK IS BAD":TRIES=TRIES+1: IF TRIES<3 THEN RESUME ERL: ELSE PRINT "ENDING...CHECK DISK": FOR I=1 TO 3000:NEXT I:GOTO 1770
15105 IF MISTEAK =67 THEN PRINT "YOU HAVE TOO MANY FILES OPEN AT ONE TIME": FOR I=1 TO 3000:NEXT I: RESUME 130
15110 ON ERROR GOTO 0: RESUME
20000 REM This subroutine switches the active and visual pages in SCREEN 0
20010 REM mode to page 1, thus allowing the programmer to put "help"
20020 REM material, ancillary input, or other messages on a "clean slate."